Here are examples with restrictions on run lengths Let a(n) be the number of Motzkin paths of length n The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 2 P x + P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 9, 21, 51, 127, 323, 835, 2188, 5798, 15511, 41835, 113634, 310572, 853467, 2356779, 6536382, 18199284, 50852019, 142547559, 400763223, 1129760415, 3192727797, 9043402501, 25669818476, 73007772802, 208023278209, 593742784829, 1697385471211, 4859761676391, 13933569346707, 40002464776083, 114988706524270, 330931069469828, 953467954114363, 2750016719520991, 7939655757745265, 22944749046030949, 66368199913921497, 192137918101841817, 556704809728838604, 1614282136160911722, 4684478925507420069, 13603677110519480289, 39532221379621112004, 114956499435014161638, 334496473194459009429, 973899740488107474693, 2837208756709314025578, 8270140811590103129028, 24119587499879368045581, 70380687801729972163737, 205473381836953330090977, 600161698382141668958313, 1753816895177229449263803, 5127391665653918424581931, 14996791899280244858336604, 43881711243248048262611670, 128453535912993825479057919, 376166554620363320971336899, 1101997131244113831001323618, 3229547920421385142120565580, 9468017265749942384739441267, 27766917351255946264000229811, 81459755507915876737297376646, 239056762740830735069669439852, 701774105036927170410592656651, 2060763101398061220299787957807, 6053261625552368838017538638577, 17785981695172350686294020499397, 52274487460035748810950928411209, 153681622703766437645990598724233, 451929928113276686826984901736388, 1329334277731700374912787442584082, 3911184337415864255099077969308357, 11510402374965653734436362305721089, 33882709435158403490429948661355518, 99762777233730236158474945885114348, 293804991106867190838370294149325217, 865461205861621792586606565768282577, 2549948950073051466077548390833960154, 7514646250637159480132421134685515996, 22150145406114764734833589779994282345, 65303054248346999524711654923215773701, 192564948449128362785882746541078077821, 567944426681696509718034692302003744197, 1675395722976475387857861526496400455935, 4943221572052274428484817274841589781103, 14587540897567180436019575590444202957764, 43055804394719442101962182766220627765254, 127103430617648266466982424978107271745123, 375281510930976756310181851730346874521559, 1108229819877900763405338193186744667723583, 3273209089476438052473101825635320104642103, 9669131152389329200998265687814683780583133, 28567321136213468215221364999058944720713501, 84414794291793480358891042199686850901302514, 249478578991224378680142561460010030467811580, 737415571391164350797051905752637361193303669] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {2*r+1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 3 4 P x + P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 2, 5, 11, 21, 39, 78, 169, 373, 808, 1727, 3719, 8153, 18100, 40315, 89770, 200250, 448755, 1010685, 2284295, 5173961, 11740697, 26699780, 60863291, 139045991, 318247190, 729572315, 1675085099, 3851795549, 8869990949, 20453679944, 47223844863, 109158778599, 252604015833, 585174569218, 1356973491982, 3149735337754, 7317648949973, 17015513837075, 39598426344065, 92226215724925, 214960726414060, 501392153688235, 1170297091059795, 2733395493971805, 6388295260816794, 14939382992400893, 34957075546108784, 81843170007989408, 191719137903971163, 449340400645188279, 1053669037504714893, 2471974101275463571, 5802126077894675905, 13624699663538233690, 32007856448096806967, 75226317338842797539, 176872600555474162742, 416028562185462834959, 978931066986261206519, 2304317178615943487921, 5426110485287558975882, 12781637833858699735529, 30118363153047742826780, 70993548985271935723220, 167395948171133620323995, 394825846120114416692075, 931530329064318631964845, 2198444903759037062732875, 5189886429486818634732460, 12255201730481109442249077, 28946776678335208295051514, 68390221918322311972853538, 161621417667583306295332400, 382042836894075953678656310, 903297323085914112761473358, 2136250916987625377092633426, 5053289043686626660462496623, 11956220401510954415676353581, 28294968932068582675221243651, 66975782295057080673288203835, 158568690746068265272565281980, 375496628044581375979520322485, 889368113881999227446844159455, 2106890704245370158602348893265, 4992125453481138398138655128485, 11830692390364145497073158861960, 28042339256274399552941591817655, 66480763114930968744372113915955, 157635403864557662020572111960270, 373840136451075364203781498798455, 886729014690105878178790219978295, 2103619683405884811472252681737905, 4991296588866498929565050565274895, 11844805897660552269696314904056830, 28113153161129544493379279051871985, 66735492255321977988228130463268985, 158441365664897254313540199941374545] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {5*r+2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 6 10 5 9 4 8 4 7 3 6 2 3 2 P x + P x + P x + P x + P x + P x + P x + P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 1, 2, 4, 8, 17, 38, 87, 205, 494, 1211, 3011, 7574, 19233, 49227, 126845, 328735, 856250, 2240177, 5884149, 15510765, 41019189, 108798346, 289356017, 771479994, 2061657645, 5521219839, 14815445609, 39828758531, 107257609007, 289308155038, 781539271180, 2114261702676, 5727277030865, 15534094029009, 42183391168466, 114679782743432, 312101774786569, 850248350502440, 2318534191069745, 6328181630642719, 17287139184392053, 47263779320241326, 129323799024464403, 354126002354512918, 970403154668404824, 2661020279652020534, 7301854790809282101, 20049124621198885246, 55083782642059542185, 151428551847586201872, 416521681893219174501, 1146315078022761560353, 3156444635469445864384, 8695845962820347047477, 23968295278821145923215, 66094705174875734095424, 182344791039995647224502, 503280998674307361109532, 1389670484956921600026652, 3838762292321461925128447, 10608230439836928948437019, 29326587788496380472624557, 81103906190397803863376071, 224377176669309503772073629, 620965550216329667677255594, 1719110206543493648622672576, 4760833321900248459914078004, 13188674002078802219357196022, 36547209100601516453538345726, 101306760483264948566704626684, 280898952437386338490861141375, 779086714591820302207274637544, 2161434666312229343392892809731, 5998129577005977796908682165809, 16649603678430334624691713550013, 46227809176425079575633066776469, 128384094517550685925655959173576, 356635756736925826808882463717016, 990926976854533314693819410427803, 2753968567870783555229800877906783, 7655515016837345646545656846270225, 21285584856637711302837668859289207, 59195708598792739563463137783056890, 164659245452262243970743346193624378, 458111460485076843527315218354503026, 1274803598671365914424999916694830302, 3548138089331102097503142230858127094, 9877361353218321336411373563039891208, 27501901177291528074810594774763617922, 76588585751439674831224558851785662992, 213325715586671990182098619548713077146, 594290141626152637256045682356254387916, 1655878144935386445268643729597088558737, 4614569443946542196752672488453486768891, 12861909253814126620177205960288607178661, 35854994988189350490635110261181372219042, 99968328983620937694769227776671594357069, 278767638412641866545078234854672824537992, 777477970579562398542092452341827111996314, 2168694302309058436345052895340808129480733] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No downward run can have length in {2*r+1,5*r+2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation FAIL Cannot find the equation from the first 101 terms of the sequence Here are the terms a(n) from n=0 to n=100 [1, 1, 1, 1, 1, 1, 1, 1, 2, 7, 22, 57, 128, 261, 499, 913, 1623, 2850, 5050, 9231, 17640, 35168, 72131, 149665, 310043, 636270, 1289492, 2581661, 5120016, 10100491, 19911851, 39386881, 78392500, 157167831, 317255484, 643739806, 1310247139, 2669719428, 5437397808, 11060248451, 22465062463, 45578977976, 92430936449, 187495727196, 380694358857, 774055943891, 1576396106388, 3215393173821, 6567156676643, 13426190710039, 27467227445065, 56213947167974, 115070511952996, 235583329566210, 482386379854248, 987987233743797, 2024232497971351, 4149219750695682, 8509441562828214, 17461373274195163, 35850493278596501, 73643471045254835, 151345929819399621, 311155686766302937, 639928596142057902, 1316481351867743116, 2709052823356266883, 5576180280842681523, 11480867066575316847, 23644800272441594032, 48710707723267673210, 100379317985267757434, 206916761375844521446, 426654758937846971361, 879999771246487336640, 1815547702575267857760, 3746670682660001537014, 7733749901496879914138, 15967481986907018683571, 32974686014038096861215, 68111469601507069955008, 140719265825702784441597, 290790058699136347792187, 601031702610241962919396, 1242527624512311245705578, 2569237556406313482447195, 5313617636433891289600066, 10991630209848723190844312, 22741410734936090863095746, 47060204915498032617062107, 97402262823616875606877504, 201632704834835431173936699, 417472344192114227270469289, 864505169683256851803678090, 1790519997699265696231887504, 3709036832170606032266133549, 7684440937548898370934042830, 15923237161000688574324119911, 33000246593465920620309323319, 68401950781775219161358645991, 141802531918333936999002037536] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No flat run can have length in {2*r+1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 2 2 P x + P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 2, 0, 6, 0, 22, 0, 90, 0, 394, 0, 1806, 0, 8558, 0, 41586, 0, 206098, 0, 1037718, 0, 5293446, 0, 27297738, 0, 142078746, 0, 745387038, 0, 3937603038, 0, 20927156706, 0, 111818026018, 0, 600318853926, 0, 3236724317174, 0, 17518619320890, 0, 95149655201962, 0, 518431875418926, 0, 2832923350929742, 0, 15521467648875090, 0, 85249942588971314, 0, 469286147871837366, 0, 2588758890960637798, 0, 14308406109097843626, 0, 79228031819993134650, 0, 439442782615614361662, 0, 2441263009246175852478, 0, 13582285614213903189954, 0, 75672545337796460900418, 0, 422158527806921249683014, 0, 2358045034996817096518614, 0, 13186762229969911326195738, 0, 73825509266803210054176714, 0, 413744003711584755242223438, 0, 2321083025362608992223726894, 0, 13033522069997514889215092274, 0, 73252943452863199223393858898, 0, 412061442720070604908289934294, 0, 2319824936637513933714881477958, 0, 13070393952625514917631908633482, 0, 73696580719034769214303906556250, 0, 415831259625127007215514095957086, 0, 2347928652146955633301765770354078, 0, 13265947508553602309369175431365026, 0, 75000761566763827145224941186411618, 0, 424283543233691838260433080620759398] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No flat run can have length in {2*r+1,5*r+2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 10 10 2 8 2 6 8 6 2 2 4 P x + P x + P x + P x + x + x + P x + x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 1, 0, 3, 0, 9, 0, 28, 0, 94, 0, 332, 0, 1218, 0, 4582, 0, 17578, 0, 68529, 0, 270727, 0, 1081402, 0, 4360212, 0, 17722232, 0, 72536949, 0, 298713669, 0, 1236790952, 0, 5145463808, 0, 21499180280, 0, 90178494353, 0, 379584635004, 0, 1602880879318, 0, 6788301002252, 0, 28825926035051, 0, 122708712940713, 0, 523547039175347, 0, 2238470834992619, 0, 9589536143514176, 0, 41156257609659059, 0, 176935003480989701, 0, 761875118532028298, 0, 3285511126519782673, 0, 14188356012539454796, 0, 61352956409471359582, 0, 265632090734916526333, 0, 1151429277436336926283, 0, 4996641015575527585578, 0, 21705900954628636849962, 0, 94387145199575020309896, 0, 410829458339381695932243, 0, 1789797518667027309033634, 0, 7804070078882962344372850, 0, 34056184227751514253301401, 0, 148734662237559067075143177, 0, 650061825445042536343520166, 0, 2843212175698666739891410538, 0, 12444079617983901971812558630, 0, 54500788734394133935470016197, 0, 238845816167442935342496545650, 0, 1047360953458801772477180138908] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {2r+1} and no flat run can have length in {2r+1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 2 P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 1, 0, 2, 0, 5, 0, 14, 0, 42, 0, 132, 0, 429, 0, 1430, 0, 4862, 0, 16796, 0, 58786, 0, 208012, 0, 742900, 0, 2674440, 0, 9694845, 0, 35357670, 0, 129644790, 0, 477638700, 0, 1767263190, 0, 6564120420, 0, 24466267020, 0, 91482563640, 0, 343059613650, 0, 1289904147324, 0, 4861946401452, 0, 18367353072152, 0, 69533550916004, 0, 263747951750360, 0, 1002242216651368, 0, 3814986502092304, 0, 14544636039226909, 0, 55534064877048198, 0, 212336130412243110, 0, 812944042149730764, 0, 3116285494907301262, 0, 11959798385860453492, 0, 45950804324621742364, 0, 176733862787006701400, 0, 680425371729975800390, 0, 2622127042276492108820, 0, 10113918591637898134020, 0, 39044429911904443959240, 0, 150853479205085351660700, 0, 583300119592996693088040, 0, 2257117854077248073253720, 0, 8740328711533173390046320, 0, 33868773757191046886429490, 0, 131327898242169365477991900, 0, 509552245179617138054608572, 0, 1978261657756160653623774456] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {2r+1, 5r+2} and no flat run can have length in {2r+1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 1645942889333553998620149711424301197778752257750363248944588 16 ------------------------------------------------------------- P 2387801065411793356848144403496978244427866801454348375380075 + 49775106381932958482637311301948836527370062084396044570847648 -------------------------------------------------------------- + 2387801065411793356848144403496978244427866801454348375380075 492387638057825724268722042311643840788609962335546164914226332 --------------------------------------------------------------- 477560213082358671369628880699395648885573360290869675076015 2 P + 1560755353059344303373619793342888104232865188909272493693978 ------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 2 x - 367071421316894433620758099548540655802887542378538570284613 ------------------------------------------------------------- 2387801065411793356848144403496978244427866801454348375380075 4 x + 6571458303502207889975257329547136476010908255936766161803046 ------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 2 x P - 140570249167624787888477541526996858666746024544115296069353173 --------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 2 2 x P + 11201877596905668922010895707277987625182733999913989496078744 -------------------------------------------------------------- 2387801065411793356848144403496978244427866801454348375380075 4 x P - 55443398118255006801264434014943714313488212898872990951276601 -------------------------------------------------------------- 2387801065411793356848144403496978244427866801454348375380075 4 2 x P + 488198673128264939486920121502953211376903474865242273905356846 --------------------------------------------------------------- 477560213082358671369628880699395648885573360290869675076015 2 3 883295393157400432017344786359706221522124535097381531\ x P - 3841876951/238780106541179335684814440349697824442786680145434\ 8375380075 2 4 7772988234524952789277114497318912465635564\ x P + 633728472819759526382/7959336884705977856160481344989927481426\ 22267151449458460025 2 5 311783571827687752208828861794337\ x P - 2177677445147938397766497748981/159186737694119557123209626899\ 798549628524453430289891692005 2 6 72108167191509508014739\ x P + 761028790900292971110287794293047485099524/2387801065411793356\ 848144403496978244427866801454348375380075 2 7 85903608829\ x P - 036624479665496499663005798635652939531740674470196144/2387801\ 065411793356848144403496978244427866801454348375380075 2 8 x P + 79129005205780982027320593416440052799071129871615322927590283\ 072/2387801065411793356848144403496978244427866801454348375380\ 075 2 9 37388260946572815448084998480747982926711527670529\ x P - 16753588488956/15918673769411955712320962689979854962852445343\ 0289891692005 2 10 100680903358440547966912656543080737551\ x P + 88167463514232574274613584/79593368847059778561604813449899274\ 8142622267151449458460025 2 11 402580100571362564182788155\ x P - 9980443742575082582829931324901412806/795933688470597785616048\ 134498992748142622267151449458460025 2 12 x P + 137731968588236952082284948072810536273358546924015849675479848 --------------------------------------------------------------- 95512042616471734273925776139879129777114672058173935015203 2 13 x P - 217059988561105585524272205586490669370189685037217576274401459 --------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 2 14 x P + 14164220771262476139044742058582890572095102606935349653957724 -------------------------------------------------------------- 477560213082358671369628880699395648885573360290869675076015 2 15 x P - 3089090249202034515758141046758385065326121090604608403979936 ------------------------------------------------------------- 2387801065411793356848144403496978244427866801454348375380075 2 16 x P + 4044350543612538743002672352648511691469730016628379289111526 ------------------------------------------------------------- 477560213082358671369628880699395648885573360290869675076015 4 3 x P + 274734525643654299530991788008914785689253050882037934200735706 --------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 4 4 144764621146689975746762645708994045853471063158998494\ x P - 1319751106/795933688470597785616048134498992748142622267151449\ 458460025 4 5 x P + 509897357223864788496684490919927228642563265161970493742373069 --------------------------------------------------------------- 95512042616471734273925776139879129777114672058173935015203 4 6 854351407651292652061090598140167649999733866314967249\ x P - 4182207076/795933688470597785616048134498992748142622267151449\ 458460025 4 7 37561316288950789999048071401831964626189273\ x P + 534933730731203049359/2387801065411793356848144403496978244427\ 866801454348375380075 4 8 13672327506686471437604480007645\ x P - 253966928378407486237309593416984/7959336884705977856160481344\ 98992748142622267151449458460025 4 9 335141944880018890077\ x P + 60614128284162536674627450988337090505230904/23878010654117933\ 56848144403496978244427866801454348375380075 4 10 20327996\ x P - 343897843377309520291448713639093846449951989236885771094/2387\ 801065411793356848144403496978244427866801454348375380075 4 x 11 29882126081816690052558837882354083440726671726880981360\ P + 20676063/79593368847059778561604813449899274814262226715144945\ 8460025 4 12 x P - 920480150517771535603968327911750059665149650198066517660407488 --------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 4 13 x P + 550686191747783042062748154182248321794107535643452834298871207 --------------------------------------------------------------- 2387801065411793356848144403496978244427866801454348375380075 4 14 x P - 20218768578132548705365019045383964737454517566272543366228364 -------------------------------------------------------------- 795933688470597785616048134498992748142622267151449458460025 4 15 4 16 x P + x P - 168016684711870842959329330895377391720531976074227939203868017 --------------------------------------------------------------- P - 795933688470597785616048134498992748142622267151449458460025 6589411717297608394769861085675489026726675296746118119374396 ------------------------------------------------------------- 477560213082358671369628880699395648885573360290869675076015 15 26502883760460275685742726163846168180546182332645634432\ P - 05095267/79593368847059778561604813449899274814262226715144945\ 8460025 3 1927006954354389487022370197084961327880848242241\ P + 6025403778466748/238780106541179335684814440349697824442786680\ 1454348375380075 4 1228704824230760999282878386424620527059\ P - 5040040930695880562556817/795933688470597785616048134498992748\ 142622267151449458460025 5 56446491028638367281640206237841\ P + 083205735678585376641821065778353/2387801065411793356848144403\ 496978244427866801454348375380075 6 69294023597695431958209\ P - 095975003304262375746166557856404063667768/2387801065411793356\ 848144403496978244427866801454348375380075 7 68073273271179\ P + 462570883380716434573562691276813806418349914514807/2387801065\ 411793356848144403496978244427866801454348375380075 8 35541\ P - 51567925575121679320185448288865818658195780183709444264472/ 159186737694119557123209626899798549628524453430289891692005 9 11010395496132195630110333855012427289597913531746304513252860664/795933688470597785616048134498992748142622267151449458460025 P + 10 15966156124064314306958769981351414428223554786600533231\ P - 679376166/2387801065411793356848144403496978244427866801454348\ 375380075 11 P + 78408946328377086003547368805441311393269786348594748013538455 -------------------------------------------------------------- 31837347538823911424641925379959709925704890686057978338401 12 15875996756520819991368530005230048802058402073307810450\ P - 13102137/23878010654117933568481444034969782444278668014543483\ 75380075 13 P + 294009338131480147386317655466789832136607205481636254007895513 --------------------------------------------------------------- 2387801065411793356848144403496978244427866801454348375380075 14 P = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 1, 0, 1, 0, 1, 0, 2, 0, 7, 0, 23, 0, 65, 0, 168, 0, 428, 0, 1134, 0, 3159, 0, 9063, 0, 26183, 0, 75464, 0, 217313, 0, 628352, 0, 1829984, 0, 5367952, 0, 15830840, 0, 46855480, 0, 139056226, 0, 413753002, 0, 1234455863, 0, 3693243754, 0, 11078067887, 0, 33306043760, 0, 100339565903, 0, 302853107864, 0, 915697289866, 0, 2773281160907, 0, 8412404605409, 0, 25555820651163, 0, 77743087124080, 0, 236808968000877, 0, 722214003062572, 0, 2205140656361222, 0, 6740364612270526, 0, 20624479594302047, 0, 63170204922730040, 0, 193664409356976947, 0, 594258894425861404, 0, 1825036447888420723, 0, 5609451299564275094, 0, 17254659922491972001, 0, 53114711072320992620, 0, 163618260844085783125, 0, 504364182506058727927, 0, 1555750723451542600203, 0, 4801839455588462023312, 0, 14829835738120052460369] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {2r+1} and no flat run can have length in {2r+1,5r+2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 3 12 3 10 3 8 10 8 3 4 6 4 P x + P x + P x + P x + x + P x + x + x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 0, 0, 2, 0, 1, 0, 8, 0, 5, 0, 43, 0, 38, 0, 282, 0, 308, 0, 1990, 0, 2575, 0, 14899, 0, 22123, 0, 116381, 0, 193394, 0, 938880, 0, 1713086, 0, 7770450, 0, 15333244, 0, 65661560, 0, 138414098, 0, 564503268, 0, 1258428990, 0, 4924155326, 0, 11511755083, 0, 43488848917, 0, 105872501066, 0, 388202210934, 0, 978338089054, 0, 3497529521494, 0, 9079151024973, 0, 31767434661254, 0, 84581606325608, 0, 290600612749943, 0, 790739295647607, 0, 2675139472537987, 0, 7416373278845520, 0, 24764352618286621, 0, 69765713799188556, 0, 230397080604260266, 0, 658096779552693225, 0, 2153135702275412401, 0, 6223732968114218723, 0, 20202983845585803096, 0, 58999859098501306439, 0, 190256724512618034155, 0, 560560995724633122338, 0, 1797616913372499608395, 0, 5337110232698795577821, 0, 17035601820021483353395] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {2*r+1,5*r+2} and no flat run can have length in {2*r+1,5*r+2} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 8101299281769393612039405701968007310289466986690194070808646433\ 481097395449468064379130681387/2587149598676304352969020245218\ 7279804220132560468422689741360158021634815235775310364942208905 16 66825650533593989302162608733003049990729908015252577376\ P + 90430462907123791288624510952834247763334/25871495986763043529\ 69020245218727980422013256046842268974136015802163481523577531\ 0364942208905 2 1935696943138550097830840345933131605765221\ P - 17985208255629240197063679367092209622205446197946712/60366823\ 96911376823594380572177031954318030930775965294272984036871714\ 7902216809057518198487445 2 1648408147647868706179592040459\ x + 17145678187432000938444695514867217696351750326266046667398064\ 147/3622009438146826094156628343306219172590818558465579176563\ 7904221230288741330085434510919092467 4 7979463241603540030\ x + 17478084400222978132847954678686032003615703860450257665231245\ 1142427642836119/181100471907341304707831417165310958629540927\ 923278958828189521106151443706650427172554595462335 2 x P - 51392277126440345061686127448838445588283440077155645074268097\ 319524282715633834489942268461454504/1811004719073413047078314\ 17165310958629540927923278958828189521106151443706650427172554\ 595462335 2 2 11095637805543036519385729082878671912243974\ x P - 761054253658625521896235314092731757632813993596106371/1811004\ 71907341304707831417165310958629540927923278958828189521106151\ 443706650427172554595462335 4 702203426057394362594826672\ x P + 39625462863082002944936504538215254272276245122201499939291080\ 998673489/1811004719073413047078314171653109586295409279232789\ 58828189521106151443706650427172554595462335 4 2 103192965\ x P + 10243829876440239922702958621786841189437576987647534577228929\ 4499036939326568023463146/362200943814682609415662834330621917\ 25908185584655791765637904221230288741330085434510919092467 - 16239711949989359741691734884746687214127527396121152492275365\ 3810546933048682841469107049152304750/120733647938227536471887\ 61144354063908636061861551930588545968073743429580443361811503\ 639697489 4 9 51718604834285255876980608532373515677353515\ x P + 9533427424972997672240776660633322629118915886975943961/603668\ 23969113768235943805721770319543180309307759652942729840368717\ 147902216809057518198487445 4 10 2621086065476726110545739\ x P - 33664987540489339582742347713322943944089879425567814582351584\ 593582930417/6036682396911376823594380572177031954318030930775\ 9652942729840368717147902216809057518198487445 4 11 311660\ x P + 85758816312465502218206547043121505333835235208649432671949944\ 3332400619247978391596426857218/181100471907341304707831417165\ 31095862954092792327895882818952110615144370665042717255459546\ 2335 4 12 935643404645083795883405502273669917857983482556\ x P - 81298006156533167836095972537662750577647150799209/18110047190\ 73413047078314171653109586295409279232789588281895211061514437\ 06650427172554595462335 4 13 95622571488688044401307910615\ x P + 41045772466181041678994132675261141672944081322761475587718811\ 66786/86238319955876811765634008173957599347400441868228075632\ 47120052673878271745258436788314069635 4 14 18344346327769\ x P - 78806207365459557772819454494797111554109551170634698914733757\ 04322693392788200153/12073364793822753647188761144354063908636\ 061861551930588545968073743429580443361811503639697489 4 15 x P 4 16 20590840826208166138611689234248663387816231022280\ + x P + 7359070867549058779376083526763977130121764181991/181100471907\ 34130470783141716531095862954092792327895882818952110615144370\ 6650427172554595462335 2 3 4666041227797745594521565744461\ x P - 6899583638462061647123301043921387338223527279273979829801286109/181100471907341304707831417165310958629540927923278958828189521106151443706650427172554595462335 2 16 57434724074538518873159497485878961975751051196045501\ x P - 5369734725773256418153951844175821033496961436/181100471907341\ 30470783141716531095862954092792327895882818952110615144370665\ 0427172554595462335 2 4 1182480086568319415860708327730307\ x P + 41522533366749342374948624391244059309084877692378882531192700\ 5898/181100471907341304707831417165310958629540927923278958828\ 189521106151443706650427172554595462335 2 5 12390480806660\ x P - 03147819261166325993462733956913182531002095106431857032907515\ 15434219622251226569473/12073364793822753647188761144354063908\ 636061861551930588545968073743429580443361811503639697489 2 6 758205446016490841370664829301457514135757403943441107227709821544353383828488946770464796074422311/60366823969113768235943805721770319543180309307759652942729840368717147902216809057518198487445 x P + 2 7 219036942116677429250566504068121695516847921813576780\ x P - 1660875456971228766889802307037427807051315098/181100471907341\ 30470783141716531095862954092792327895882818952110615144370665\ 0427172554595462335 2 8 3329878758505090638058752201637272\ x P + 89908515763925935685315370794702860280024863033450837091774735\ 192/3622009438146826094156628343306219172590818558465579176563\ 7904221230288741330085434510919092467 2 9 3318413674271041\ x P - 20168236928339157011171945218598657346047285336484507744419779\ 099711649668315270836/6036682396911376823594380572177031954318\ 0309307759652942729840368717147902216809057518198487445 2 10 66180331397382244024023888483883440089454579476638429055298729373333343145149058199902132558077947/25871495986763043529690202452187279804220132560468422689741360158021634815235775310364942208905 x P + 2 11 78307495196083040735018139293421259455825040817323889\ x P - 68993721823451728955086858763978941595819972/86238319955876811\ 76563400817395759934740044186822807563247120052673878271745258\ 436788314069635 2 12 1434578175376258424289078393251446038\ x P + 2874756145138245691270818938717784598396190030635827180921744/ 60366823969113768235943805721770319543180309307759652942729840\ 368717147902216809057518198487445 2 13 2609734932141549642\ x P - 19322285503829579598672660201256713721780993882344847299695216\ 8991107738989326/603668239691137682359438057217703195431803093\ 07759652942729840368717147902216809057518198487445 2 14 x P + 88413610534956417275074551329760414806835258667868744206967080\ 9791815162105611549701029598121514/181100471907341304707831417\ 16531095862954092792327895882818952110615144370665042717255459\ 5462335 2 15 132144384891576341194254823067211280834430399\ x P - 71739810194783952789633065346678489963302216076683588/86238319\ 95587681176563400817395759934740044186822807563247120052673878\ 271745258436788314069635 4 3 76720164091517680203546913253\ x P + 73219284605947727354884885997055932579781780772202254650974664\ 16937142/18110047190734130470783141716531095862954092792327895\ 8828189521106151443706650427172554595462335 4 4 3150783753\ x P - 70707749208421078458001755071013257120742848740592652578056773\ 856543519774635832124055301/3622009438146826094156628343306219\ 1725908185584655791765637904221230288741330085434510919092467 4 5 248954831237291711556518892418788631906495808580014488\ x P + 5902135165883778946493006086024398627421624068/181100471907341\ 30470783141716531095862954092792327895882818952110615144370665\ 0427172554595462335 4 6 4421117561710710069107150849373568\ x P - 61517672429531279732299453595899383581639865955994058734072308\ 659/2587149598676304352969020245218727980422013256046842268974\ 1360158021634815235775310364942208905 4 7 3066096277615699\ x P + 98000193986686278522839971471224274752888922751987024004588965\ 0142280807593878574298/181100471907341304707831417165310958629\ 540927923278958828189521106151443706650427172554595462335 4 8 190119306343564340265557114631516350471509359657428417114891565630096224781892774277481345043278461/181100471907341304707831417165310958629540927923278958828189521106151443706650427172554595462335 x P - 3 179605675763322330629269938448417731531266066027059852585\ P + 505041693041894098602699652371630314234552/6036682396911376823\ 59438057217703195431803093077596529427298403687171479022168090\ 57518198487445 4 112906506005475593400998262425021553648092\ P - 1799507497325804737511341175068986783652939849004652048807/ 18110047190734130470783141716531095862954092792327895882818952\ 1106151443706650427172554595462335 5 6031307439161031532037\ P + 73275762916268810239976454828720770593218478849212761394753233\ 110718914947191/6036682396911376823594380572177031954318030930\ 7759652942729840368717147902216809057518198487445 6 1434166\ P - 18195048251456472766151397567076845978213906134694101084241152\ 1375083289832349455182562417/362200943814682609415662834330621\ 91725908185584655791765637904221230288741330085434510919092467 P - 1066186707576213542337838536706668472796586352042598424303262019158417228887398452068609988891442/181100471907341304707831417165310958629540927923278958828189521106151443706650427172554595462335 15 32312370062291681110971188137821053278484640183231533366\ P - 9834634165623140328956878412165140149799166/258714959867630435\ 29690202452187279804220132560468422689741360158021634815235775\ 310364942208905 7 22286297115847554104208071861192172040974\ P + 48818019783659246982048476178365658318441531183836535196576/ 18110047190734130470783141716531095862954092792327895882818952\ 1106151443706650427172554595462335 8 3472203614674179543429\ P - 61490353300471609751575520720833331671389556298423647826354838\ 228908179358332/3622009438146826094156628343306219172590818558\ 4655791765637904221230288741330085434510919092467 9 1065264\ P + 76571471088675924770515366401762839170421749340873731506218316\ 8659218475270510054483028051039/181100471907341304707831417165\ 31095862954092792327895882818952110615144370665042717255459546\ 2335 10 509129318599967749655717712066973915961057490896269\ P - 259192925459197833110914548449419037495541851628/1811004719073\ 41304707831417165310958629540927923278958828189521106151443706\ 650427172554595462335 11 6187802105532741631060681503549905\ P + 8405196608761427826978932570399212457765551555113123215248879622/60366823969113768235943805721770319543180309307759652942729840368717147902216809057518198487445 12 16616097011594753917931788890322564217990653588932833834\ P - 682974134199958887481183365522941444956733/6036682396911376823\ 59438057217703195431803093077596529427298403687171479022168090\ 57518198487445 13 92782765501829939113798229153946729950614\ P + 06614261127761710508876871006545077758836244730655277957/18110\ 04719073413047078314171653109586295409279232789588281895211061\ 51443706650427172554595462335 14 P = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 0, 0, 1, 0, 1, 0, 2, 0, 1, 0, 7, 0, 7, 0, 35, 0, 45, 0, 168, 0, 245, 0, 841, 0, 1364, 0, 4397, 0, 7832, 0, 23911, 0, 45725, 0, 133588, 0, 269839, 0, 761460, 0, 1606893, 0, 4415358, 0, 9649169, 0, 25975036, 0, 58373248, 0, 154661782, 0, 355432882, 0, 930311278, 0, 2176773082, 0, 5644794633, 0, 13400978886, 0, 34508268001, 0, 82892920132, 0, 212337049070, 0, 514958381156, 0, 1314019653491, 0, 3211737312589, 0, 8172539660542, 0, 20103879847446, 0, 51055775099953, 0, 126260205290562, 0, 320226666879766, 0, 795404564416137, 0, 2015665060627746, 0, 5025096779096563, 0, 12728482660877950, 0, 31830639716249627, 0, 80612535590592809, 0, 202120085854033308, 0, 511898658896301427] ---------------------------- Let a(n) be the number of Motzkin paths of length n with the following restrictions No upward run can have length in {2r+1}, no downward run can have length in {2r+1}, and no flat run can have length in {2r+1} The generating function P(x) of the sequence a(n) satisfies the algebraic equation 2 4 2 P x + P x - P + 1 = 0 Here are the terms a(n) from n=0 to n=100 [1, 0, 1, 0, 2, 0, 4, 0, 9, 0, 21, 0, 51, 0, 127, 0, 323, 0, 835, 0, 2188, 0, 5798, 0, 15511, 0, 41835, 0, 113634, 0, 310572, 0, 853467, 0, 2356779, 0, 6536382, 0, 18199284, 0, 50852019, 0, 142547559, 0, 400763223, 0, 1129760415, 0, 3192727797, 0, 9043402501, 0, 25669818476, 0, 73007772802, 0, 208023278209, 0, 593742784829, 0, 1697385471211, 0, 4859761676391, 0, 13933569346707, 0, 40002464776083, 0, 114988706524270, 0, 330931069469828, 0, 953467954114363, 0, 2750016719520991, 0, 7939655757745265, 0, 22944749046030949, 0, 66368199913921497, 0, 192137918101841817, 0, 556704809728838604, 0, 1614282136160911722, 0, 4684478925507420069, 0, 13603677110519480289, 0, 39532221379621112004, 0, 114956499435014161638, 0, 334496473194459009429, 0, 973899740488107474693, 0, 2837208756709314025578]